package com.sushi.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sushi.bean.User;
import com.sushi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/u")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping
    public String getAll() {
//        List<User> all = userService.findAll();
        Page<User> all = userService.findAll();
        return all.toString();
    }


}
